package org.cjprods.rsms.filters;

import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;

public class cache implements Filter
{
    @Override public void init(FilterConfig filterConfig) {}
    @Override public void destroy() {}

    @Override
    public void doFilter(ServletRequest request,
                         ServletResponse response,
                         FilterChain chain) throws IOException, ServletException
    {
        HttpServletResponse r = (HttpServletResponse)response;
        r.setHeader("Cache-Control", "private, no-store, no-cache, must-revalidate");   // HTTP/1.1
        r.setHeader("Pragma", "no-cache");                                              // HTTP/1.0
        r.setDateHeader("Expires", 0);                                                  // proxy

        chain.doFilter(request, response);
    }
}

